﻿namespace _5._10._1.School
{
    using System;
    using System.Collections.Generic;

    public class Course
    {
        private string name;
        private ICollection<Student> students;

        public Course(string name)
        {
            this.Name = name;
            this.Students = new List<Student>();
        }

        public ICollection<Student> Students
        {
            get
            {
                return this.students;
            }

            private set
            {
                this.students = value;
            }
        }
        public string Name
        {
            get
            {
                return this.name;
            }

            set
            {
                if (value == null)
                {
                    throw new ArgumentNullException();
                }

                this.name = value;
            }
        }

        public void AddStudent(Student student)
        {
            this.Students.Add(student);
        }

        public void RemoveStudent(Student student)
        {
            this.Students.Remove(student);
        }
    }
}